# create a new releng system
# NOTE: should be used with --limit most of the time
# NOTE: make sure there is room/space for this instance on the buildvmhost
# NOTE: most of these vars_path come from group_vars/releng or from hostvars

- name: make releng systems
  hosts: branched-composer.phx2.fedoraproject.org:rawhide-composer.phx2.fedoraproject.org
  user: root
  gather_facts: False
  accelerate: "{{ accelerated }}"

  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "{{ private }}/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  tasks:
  - include: "{{ tasks }}/virt_instance_create.yml"

  handlers:
  - include: "{{ handlers }}/restart_services.yml"

# Once the instance exists, configure it. 

- name: make releng server system
  hosts: branched-composer.phx2.fedoraproject.org:rawhide-composer.phx2.fedoraproject.org
  user: root
  gather_facts: True
  accelerate: "{{ accelerated }}"

  vars_files:
  - /srv/web/infra/ansible/vars/global.yml
  - "{{ private }}/vars.yml"
  - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - base
  - nagios_client
  - collectd/base
  - hosts
  - builder_repo
  - { role: nfs/client, mnt_dir: '/pub/fedora',  nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub/fedora' }
  - { role: nfs/client, mnt_dir: '/mnt/fedora_koji',  nfs_src_dir: 'fedora_koji' }
  - releng
  - fedmsg/base

  tasks:
  - include: "{{ tasks }}/motd.yml"

  handlers:
  - include: "{{ handlers }}/restart_services.yml"

